import request from '@/utils/request'

//查询控价商品表
export function listSpecialty(query) {
  return request({
    url: '/goods/specialty',
    method: 'get',
    params: query
  })
}
export function addSpecialty(asd) {
  return request({
    url: '/goods/specialty/add',
    method: 'post',
    data: asd
  })
}
export function deleteSpecialty(asd) {
  return request({
    url: '/goods/specialty/deleteBatch',
    method: 'delete',
    data: asd
  })
}
export function choiceSpecialty(boolean) {
  return request({
    url: '/goods/specialty/choice/' + boolean,
    method: 'get',
  })
}
export function insertSpecialty(sn, presents) {
  return request({
    url: `/order/order/${sn}/replenish/add`,
    method: 'post',
    data: presents
  })
}
export function updateSpecialty(sn, presents) {
  return request({
    url: `/order/order/${sn}/replenish/update`,
    method: 'put',
    data: presents
  })
}
//订单详情删除
export function deleteOrderSpecialty(sn, id) {
  return request({
    url: `/order/order/${sn}/replenish/del/${id}`,
    method: 'delete',
  })
}
//取消订单商品优惠券
export function loseOrderSpecialty(id) {
  return request({
    url: `/order/orderItem/coupon/cancel/${id}`,
    method: 'put',
  })
}
//修改订单运费
export function freightSpecialty(id, presents) {
  return request({
    url: `/order/order/${id}/freightPrice`,
    method: 'put',
    data: presents
  })
}

//获取会员优惠券
export function getIDSpecialty(presents) {
  return request({
    url: `/store/promotion/coupon/memberCoupons`,
    method: 'get',
    params: presents
  })
}
//绑定会员优惠券
export function giveSpecialty(memberid, ordersn, presents) {
  return request({
    url: `/order/order/${memberid}/${ordersn}/orderUseCoupon`,
    method: 'put',
    data: presents
  })
}